<?php

use App\Http\Controllers\AuthController;
use App\Http\Controllers\BasePagesController;
use App\Http\Controllers\FollowersController;
use App\Http\Controllers\TopicController;
use App\Http\Controllers\UserController;
use App\Models\User;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/',[BasePagesController::class,'home'])->name('home');
Route::get('/help',[BasePagesController::class,'help'])->name('help');
Route::get('/about',[BasePagesController::class,'about'])->name('about');

Route::resource('user',UserController::class);

Route::get('login',[AuthController::class,'login_show'])->name('login.show');
Route::post('login',[AuthController::class,'login'])->name('login');
Route::delete('logout',[AuthController::class,'logout'])->name('logout');

Route::get('register/confirm/{token}', [UserController::class,'confirmEmail'])->name('confirm_email');

Route::get('password/reset',  [AuthController::class,'showLinkRequestForm'])->name('password.request');
Route::post('password/email',  [AuthController::class,'sendResetLinkEmail'])->name('password.email');
Route::get('password/reset/{token}',[AuthController::class,'showResetForm'])->name('password.reset');
Route::post('password/reset',  [AuthController::class,'reset'])->name('password.update');

Route::resource('topic',TopicController::class);

Route::get('user/{user}/followings', [UserController::class,'followings'])->name('user.followings');
Route::get('user/{user}/followers', [UserController::class,'followers'])->name('user.followers');

Route::post('user/followers/{user}', [FollowersController::class,'store'])->name('followers.store');
Route::delete('user/followers/{user}', [FollowersController::class,'destroy'])->name('followers.destroy');





